import {defineStore} from 'pinia'
import {ref,reactive} from 'vue';
import type{saveUserInfoInterface} from '@/utils/interface'
export const userMolde = defineStore('user',()=>{
    const userInfo = reactive({
      nickname:'',
      avatar:''
    })
  function saveUserInfo(params:saveUserInfoInterface){
    userInfo.nickname = params.nickname;
    userInfo.avatar = params.avatar;
  }
  function clearUserInfo(){
    userInfo.nickname = ''
    userInfo.avatar = ''
  }
    return {
      userInfo,
      saveUserInfo,
      clearUserInfo,
    }
})